import Vue from 'vue'
import Router from 'vue-router'

// 导入对应的组件
import home from '@/components/tabbar/home.vue'
import member from '@/components/tabbar/member.vue'
import search from '@/components/tabbar/search.vue'
import shopcar from '@/components/tabbar/shopcar.vue'
import newslist from '@/components/news/newslist.vue'
import newsinfo from '../components/news/newsinfo.vue'
import photolist from '../components/photos/photolist.vue'
import goodslist from '../components/goods/goodslist.vue'
import goodsinfo from '../components/goods/goodsinfo.vue'
import goodsdesc from '../components/goods/goodsdesc.vue'
import goodscomment from '../components/goods/goodscomment.vue'
//@    相当于../    表示上一级的上一级目录
Vue.use(Router)

export default new Router({
  routes: [
    {path:'/',redirect:'/home'},
    {path: '/home',component:home},
    {path: '/member',component:member},
    {path: '/search',component:search},
    {path: '/shopcar',component:shopcar},
    {path:'/home/newslist',component:newslist},
    {path:'/home/newsinfo',component:newsinfo},   //匹配id后面需要加 :id
    {path:'/home/photolist',component:photolist},
    {path:'/home/goodslist',component:goodslist},
    {path:'/home/goodsinfo',component:goodsinfo,name:'goodsinfo'},
    {path:'/home/goodsdesc',component:goodsdesc,name:'goodsdesc'},
    {path:'/home/goodscomment',component:goodscomment,name:'goodscomment'}
  ],
  linkActiveClass:'mui-active'  //覆盖默认的路由高亮的类，默认的类叫做router-link-active
})
